package com.yonyou.pmclouds.procedure.mapper;

import com.yonyou.pmclouds.basecom.dao.BaseMapper;
import com.yonyou.pmclouds.procedure.entity.ProcedureRefVO;
import com.yonyou.pmclouds.procedure.entity.ProcedureVO;
import org.apache.ibatis.annotations.Param;

public interface ProcedureMapper extends BaseMapper<ProcedureVO> {

    int countCode(@Param("pkTenant") String pkTenant, @Param("scode") String scode);

    int countCodeLike(@Param("pkTenant") String pkTenant, @Param("scode") String scode);

    int countName(@Param("pkTenant") String pkTenant, @Param("sname") String sname);

    int countChild(String pkParent);

    ProcedureVO[] queryProceduresOfTenant(@Param("pkTenant") String pkTenant, @Param("enableStatus") byte enableStatus);

    ProcedureRefVO[] queryProceduresRefOfTenant(@Param("pkTenant") String pkTenant);

    ProcedureRefVO[] queryRefVOByIds(String[] ids);

    ProcedureVO[] queryProcedureByRoots(String[] pkRoots);

    ProcedureVO[] queryNameByIds(@Param("ids") String[] ids);

    String[] checkCodes(@Param("pkTenant") String pkTenant, @Param("scodes") String[] scodes);

    String[] checkNames(@Param("pkTenant") String pkTenant, @Param("snames") String[] snames);

    ProcedureVO[] querySelfAndChildrenByCodeAndStatus(@Param("scode") String scode,
                                                      @Param("pkTenant") String pkTenant, @Param("enableStatus") byte enableStatus);

    ProcedureRefVO[] queryProceRefByRoots(String[] pkRoots);//
    //查询根节点下的所有信息
    ProcedureVO[] queryFirstCategory(@Param("pkTenant") String pkTenant);
    //查询当前节点下的所有信息
    ProcedureVO[] queryRepetition(@Param("pkParent")String pkParent,@Param("pkRoot")String pkRoot,@Param("pkTenant")String pkTenant);

}
